<template>
  <van-nav-bar
    class="hmNavBar"
    @click-left="$router.push(path)"
    @click-right="clickRight"
  >
    <template #left>
      <van-icon class="f44" name="arrow-left"></van-icon>
    </template>
    <template #title>
      <div class="title">
        {{ title }}
      </div>
    </template>
    <template #right>
      <div class="right">
        {{ right }}
      </div>
    </template>
  </van-nav-bar>
</template>

<script>
export default {
  name: 'hmNavBar',
  props: {
    title: {
      type: String
    },
    path: {
      type: String
    },
    right: {
      type: String
    },
    left: {
      type: Boolean,
      default: true
    }
  },
  methods: {
    clickRight () {
      this.$save('click-right')
    }
  }
}
</script>

<style lang="less" scoped>
.hmNavBar {
  background-color: #3e9df8;
  .f44 {
    font-size: 16px;
    color: #fff;
    padding-left: 15px;
  }
  &::v-deep .van-nav-bar__left,
  &::v-deep .van-nav-bar__right {
    padding: 0;
  }
  .title {
    font-size: 18px;
    font-family: PingFangSC, PingFangSC-Semibold;
    font-weight: 600;
    text-align: center;
    color: #fff;
    line-height: 25px;
    letter-spacing: 0px;
  }
  .right {
    font-size: 14px;
    font-family: PingFangSC, PingFangSC-Regular;
    font-weight: 400;
    text-align: right;
    color: #fff;
    line-height: 20px;
    letter-spacing: 0px;
    padding-right: 15px;
  }
}
</style>
